<!-- 专家评审意见汇总与企业答复表 -->
<template>
  <div class="fcontainer">
    <el-table
      :data="tableData"
      :show-header="false"
      :span-method="objectSpanMethod"
      border
      :row-class-name="getRowClassName"
      :cell-style="{ borderColor: '#bbb' }"
      :header-cell-style="{ borderColor: '#bbb' }"
      style="width: 80%; --el-table-border-color: #bbb"
    >
      <el-table-column
        class-name="one-index"
        prop="oneIndex"
        label=""
        align="center"
      />
      <el-table-column
        class-name="two-index"
        prop="twoIndex"
        label=""
        align="center"
      />
      <el-table-column
        class-name="three-index"
        prop="threeIndex"
        label=""
        align="center"
      />
      <el-table-column
        class-name="four-index"
        prop="fourIndex"
        label=""
        align="center"
      />
      <el-table-column
        class-name="five-index"
        prop="fiveIndex"
        label=""
        align="center"
      />
      <el-table-column
        class-name="six-index"
        prop="sixIndex"
        label=""
        align="center"
      />
      <el-table-column
        class-name="seven-index"
        prop="sevenIndex"
        label=""
        align="center"
      />
      <el-table-column
        class-name="eight-index"
        prop="eightIndex"
        label=""
        align="center"
      />
    </el-table>
  </div>
</template>
<script setup name="sureTemplate">
const getRowClassName = ({ row, rowIndex }) => {
  // 这里可以访问到行数据 row 和行索引 rowIndex
  console.log("---8899---");
  console.log(row, rowIndex);
  if (rowIndex === 0) {
    return "add-background";
  }
  if (rowIndex > 0) {
    return "delete-background";
  }
  return "";
};
const tableData = ref([
  {
    oneIndex: "专家评审意见汇总与企业答复表",
    twoIndex: "",
    threeIndex: "",
    fourIndex: "",
    fiveIndex: "",
    sixIndex: "",
    sevenIndex: "",
    eightIndex: "",
  },
  {
    oneIndex: "评审次数",
    twoIndex: "专家姓名",
    threeIndex: "评审时间",
    fourIndex: "汇总意见",
    fiveIndex: "企业取回时间",
    sixIndex: "答复时间",
    sevenIndex: "答复意见",
    eightIndex: "企业送回时间",
  },
  {
    oneIndex: "一",
    twoIndex: "詹朝晖",
    threeIndex: "2015-04-21",
    fourIndex: "1个附件",
    fiveIndex: "",
    sixIndex: "",
    sevenIndex: "无附件",
    eightIndex: "",
  },
  {
    oneIndex: "二",
    twoIndex: "",
    threeIndex: "",
    fourIndex: "无附件",
    fiveIndex: "",
    sixIndex: "",
    sevenIndex: "无附件",
    eightIndex: "",
  },
  {
    oneIndex: "三",
    twoIndex: "",
    threeIndex: "",
    fourIndex: "无附件",
    fiveIndex: "",
    sixIndex: "",
    sevenIndex: "无附件",
    eightIndex: "",
  },
  {
    oneIndex: "四",
    twoIndex: "",
    threeIndex: "",
    fourIndex: "无附件",
    fiveIndex: "",
    sixIndex: "",
    sevenIndex: "无附件",
    eightIndex: "",
  },
  {
    oneIndex: "五",
    twoIndex: "",
    threeIndex: "",
    fourIndex: "无附件",
    fiveIndex: "",
    sixIndex: "",
    sevenIndex: "无附件",
    eightIndex: "",
  },
]);
const objectSpanMethod = ({ rowIndex, columnIndex }) => {
  // rowIndex, // 行索引  columnIndex, // 列索引
  if (columnIndex == 0) {
    if (rowIndex === 0) {
      return {
        rowspan: 1,
        colspan: 8,
      };
    }
  } else {
    return {
      rowspan: 1,
      colspan: 1,
    };
  }
};
</script>

<style scoped lang="scss">
.fcontainer {
  :deep(.el-table) {
    .add-background {
      font-weight: bold;
      background-color: #e4f6fd;
    }
    .delete-background .four-index {
      background: transparent !important;
      font-weight: normal !important;
    }
    .el-table__body-wrapper {
      border-color: #bbb !important; /* 例如：#f00（红色） */
    }
    .el-table__header-wrapper {
      border-color: #bbb !important; /* 例如：#f00（红色） */
    }
  }
}
</style>

